package Charpter07_file;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.BufferedOutputStream;
public class Example02 {
    public static void main(String[] args)
    throws IOException{
        FileOutputStream  out  = new FileOutputStream("H:\\test1.txt");
        BufferedOutputStream out_Beffered = new BufferedOutputStream(out);
        try {
            String s = "I am first do it ";
            out_Beffered.write(s.getBytes());
            //文件必须关闭才会生效
            out_Beffered.close();
            System.out.println("文件写入成功");
        }catch(IOException e){
            System.out.println("出现异常");
        }

    }
}
